package com.fangfaze.java.hcwork.liveLifeCycle.utils;

import com.fangfaze.java.hcwork.liveLifeCycle.entity.MessageBody;
import com.google.gson.Gson;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MessageReceiver {

    @RabbitListener(queues = "topic")
    public void process(String json) {
        MessageBody messageBody = new Gson().fromJson(json, MessageBody.class);
        System.out.println(json);
        System.out.println(messageBody.hashCode());
    }

}
